package com.android.test.dialog;

import com.android.test.R;
import com.android.test.activity.ProfilePreference;
import com.android.test.view.NumberGraph;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class WelcomeDialog extends Dialog {
    private TextView userName;
    private NumberGraph week;
    private Button continueBtn;

    public WelcomeDialog(Context context) {
	super(context);
	initialize(context);

    }

    public WelcomeDialog(Context context, int theme) {
	super(context, theme);
	initialize(context);
    }

    public WelcomeDialog(Context context, boolean cancelable,
	    OnCancelListener cancelListener) {
	super(context, cancelable, cancelListener);
	initialize(context);
    }

    private final void initialize(final Context context) {
	setContentView(R.layout.dialog_welcome);
	userName = (TextView) findViewById(R.id.user_name);
	final ProfilePreference profer = new ProfilePreference(context);
	final String name = profer.getValueByKey(ProfilePreference.COLUMN_USERNAME);
	userName.setText(name);
	week = (NumberGraph) findViewById(R.id.week_number);
	week.drawNumber(5, false);
	continueBtn = (Button) findViewById(R.id.continue_btn);
	continueBtn.setOnClickListener(new View.OnClickListener() {

	    public void onClick(View v) {
		// TODO Auto-generated method stub

	    }

	});

	// setTitle(R.string.welcome_title);
    }
}
